#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>

int main()
{
	int n = 0;
	scanf("%d", &n);
	int ji[50], ou[50];

	int count = 1;
	int jisum = 0;
	int ousum = 0;

	for (int i = 0; i < 32; i++, count++)
	{
		int num = (n >> i) & 1;
		if (count % 2 == 1)
			ji[jisum++] = num;
		else
			ou[ousum++] = num;
	}

	for (int i = jisum - 1; i >= 0; i--)
		printf("%d", ji[i]);
	printf("\n");

	for (int i = ousum - 1; i >= 0; i--)
		printf("%d", ou[i]);
	printf("\n");

	return 0;
}